import request from "@/utils/request"
// 1.用户登录请求
// 参数类型
export interface loginParamsType {
  password: string,
  username: string
}
// 返回值类型
export interface reqLoginReturnType {
  token: string
}
// 请求函数
export const requestUserLogin = (loginParams: loginParamsType) => {
  return request.post<any, reqLoginReturnType>(`/admin/acl/index/login`, loginParams)
}

// 2.获取用户信息请求
// 返回值类型
export interface requestUserInfoReturn {
  routes: string[],
  buttons: string[],
  roles: string[],
  name: string,
  avatar: string
}
export const requestUserInfo = () => {
  return request.get<any, requestUserInfoReturn>(`/admin/acl/index/info`)
}

// 3.用户登出请求
export const requestLoginOut = () => {
  return request.post<any, null>(`/admin/acl/index/logout`)
}